const http = require("http");
const url = require("url");

var reqUrl = "http://localhost:8080/";
var opitions = url.parse(reqUrl);
opitions.method = "POST";
var user = {
    userName:"zhangsan",
    age:20,
    sex:"male"
}
var userUrl = JSON.stringify(user);

var request = http.request(opitions,(res) => {
    res.pipe(process.stdout);
})

request.write(userUrl);
request.end();